package com.hzl.entity.vo.api;

import java.util.HashMap;
import java.util.Map;

/**
 * @author huangzelnag
 * @create 2022-04-30
 */
public class R {
    private Integer code;
    private String msg;
    private Object data;
    private Map<String,Object> map= new HashMap<>();



    private R(){};

    public static R Code(Integer code){
        R r= new R();
        r.setCode(code);
        return r;
    }


    public R data(Object o){
        this.data=o;
        return this;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }


    public R Msg(String msg) {
        this.msg = msg;
        return  this;
    }


    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public  R map(Map<String,Object> map){
         this.map = map;
        return this;
    }
    public  R map(String key,Object value){

        this.map.put(key,value);
        return this;
    }

    public Map<String, Object> getMap() {
        return map;
    }

    public void setMap(Map<String, Object> data) {
        this.map = data;
    }
}
